---@class Table_CharModelItem
local Table_CharModelItem = BaseClass("Table_CharModelItem", IDataItem)

function Table_CharModelItem:__ctor()
	---@type number @唯一ID
	self.Id = 0
	---@type string @名称
	self.Name = ""
	---@type string @资源路径
	self.ResPath = ""
	---@type string @动作路径
	self.AnimPath = ""
	---@type string @头像
	self.HeadPic = ""
	---@type number @头顶信息板高度修正
	self.HeadInfoHeight = 0
	---@type number @缩放比例
	self.Scale = 0
	---@type number @死亡音效
	self.DeadSound = 0
	---@type number @骨骼模型类别
	self.ModelType = 0
end

function Table_CharModelItem:Load(reader)
	self.temp = reader:ReadShortString()
	self.Id = tonumber(self.temp)
	self.Name = reader:ReadString()
	self.ResPath = reader:ReadString()
	self.AnimPath = reader:ReadString()
	self.HeadPic = reader:ReadString()
	self.temp = reader:ReadShortString()
	self.HeadInfoHeight = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.Scale = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.DeadSound = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.ModelType = tonumber(self.temp)
end

---@class Table_CharModelMgr : IDataMgr
local this = BaseClass("Table_CharModelMgr", IDataMgr)

function this:FileName()
	return "Txt/CharModel.txt"
end

---@return Table_CharModelItem
function this:GetItemByKey(key)
	return self.super.GetItemByKey(self, key)
end

---@return Table_CharModelItem
function this:GetItemByIdx(idx)
	return self.super.GetItemByIdx(self, idx)
end

function this:Load(reader)
	local item = Table_CharModelItem()
	item:Load(reader)
	self.mItemDic[item.Id] = self.mDataCount
	table.insert(self.mItemList, item)
end

---@type Table_CharModelMgr
Table_CharModelMgr = this()